/**
 * 
 */


$.ajax({
        url: "/inbox/newresults",
        async: true,
        dataType: 'json',
        data: data,
        timeout: 3000,
        success: function(json) {      
if(json == null || json.currenttime == undefined){
        return;
}
 
//json.count=Math.ceil(Math.random()*100);
 
if(json.count > 0 && json.count != monitor.numOfNewResults ){
                monitor.lastCheckingTime = json.currenttime;
                monitor.message=_("Vous avez %1 nouveaux résultats")
                        .replace('%1','<span class="val">'+json.count+'</span>');
            document.title = document.title.replace(/\s+\(\d+\)$/,'')+' ('+json.count+')'; 
        }
 
        monitor.refresh();
        monitor.numOfNewResults = json.count;
        }
});